<template>
  <view class="container">
    <uni-list v-for="(item, index) in list" :key="index">
      <uni-badge text="7" :absolute="absolute" :offset="offset">
        <uni-list-item :title="item.name" :note="item.type"
          :thumb="'/static' + item.icon" thumb-size="lg" @click="dateilist(item, index)" :clickable="true">
        </uni-list-item>
      </uni-badge>
    </uni-list>
  </view>
</template>

<script>
export default {
  data() {
    return {
      list: [
        {
          id: 1,
          name: "小甲",
          type: "信息学院",
          icon: "/images/1.png",
          description: "zz",
        },
        {
          id: 2,
          name: "小乙",
          type: "经济学院",
          icon: "/images/2.png",
          description: "xx",
        },
      ],
      offset: [20, 38],
      absolute: 'rightTop'
    }
  },
  methods: {
    dateilist(item, index) {
      console.log('Item clicked:', item);
      uni.navigateTo({
        url: `/pages/list/dateilist/dateilist?userId=${item.id}`
      });
    }
  }
}
</script>

<style>
  .content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .logo {
    height: 200rpx;
    width: 200rpx;
    margin-top: 200rpx;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 50rpx;
  }

  .text-area {
    display: flex;
    justify-content: center;
  }

  .title {
    font-size: 36rpx;
    color: #8f8f94;
  }
</style>